/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ensisa.pujaszymanski;

import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;

/**
 *
 * @author Puja, Szymanski
 */
public class Forum {
    private Hashtable<Long, Topic> topics;
    //private List<Topic> topics;

    public Forum() {
	this.topics = new Hashtable<Long, Topic>();
    }

    public Hashtable<Long, Topic> getTopics() {
	return this.topics;
    }

    public Collection<Topic> values() {
	return this.topics.values();
    }

    public Iterator<Topic> iterator() {
        return this.values().iterator();
    }

    public boolean isEmpty() {
	return this.topics.isEmpty();
    }

    public void addTopic(Topic t) {
	this.topics.put(t.getIdTopic(), t);
    }

    public Topic getTopic(long idTopic) {
        return this.topics.get(idTopic);
    }
}
